package org.springframework.security.web;

import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.security.core.AuthenticationException;

import java.io.IOException;

/**
 * @author Dillon
 * @date 2024/6/30
 * @slogan 致敬大师 致敬未来的你
 * @desc springSecurity 认证引导接口
 * 用于处理未登录用户访问受保护资源时，用户以何种方式认证
 */
public interface AuthenticationEntryPoint {

	/**
	 * 引导执行认证
	 *
	 * @param request       请求对象
	 * @param response      响应对象
	 * @param authException 认证异常
	 * @throws IOException      执行异常
	 * @throws ServletException 执行异常
	 */
	void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException;

}
